package xyc.szk.sjxy.listener;/*
 * 作者：zjLiu
 * 日期：2021-05-26
 * 公司：数学与计算机学院
 */

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;

@WebListener
public class SessionAttributeListener implements HttpSessionAttributeListener {
    @Override
    public void attributeAdded(HttpSessionBindingEvent srae) { // js(es5 es6) angular react vue  wx flutter google java↓ kotlin
        System.out.println("session域中增加了对象" + srae.getName() + "其值为" + srae.getValue());
    }

    @Override
    public void attributeRemoved(HttpSessionBindingEvent srae) {
        System.out.println("删除了" + srae.getName() + "这个session域对象");
    }

    @Override
    public void attributeReplaced(HttpSessionBindingEvent srae) {
        System.out.println("修改了" + srae.getName() + "这个session域对象,其值为:" + srae.getValue());
    }
}
